package nc.pubimpl.so.m4310.pfxx;

import nc.bs.framework.common.NCLocator;
import nc.itf.so.salequotation.ISalequotationService;
import nc.pubimpl.so.pfxx.AbstractSOPfxxPlugin;
import nc.vo.pub.AggregatedValueObject;
import nc.vo.pub.BusinessException;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
import nc.vo.so.salequotation.entity.AggSalequotationHVO;








public class M4310PfxxPlugin
  extends AbstractSOPfxxPlugin
{
  public M4310PfxxPlugin() {}
  
  protected AggregatedValueObject insert(AggregatedValueObject vo) throws BusinessException
  {
    AggSalequotationHVO[] insertvo = { (AggSalequotationHVO)vo };
    

    ISalequotationService srv = (ISalequotationService)NCLocator.getInstance().lookup(ISalequotationService.class);
    

    AggSalequotationHVO[] retvos = null;
    try {
      retvos = srv.saveBase(insertvo);
    }
    catch (Exception ex) {
      ExceptionUtils.wrappException(ex);
    }
    
    if ((null == retvos) || (retvos.length == 0)) {
      return null;
    }
    return retvos[0];
  }
  

  protected AggregatedValueObject update(AggregatedValueObject vo, String vopk) throws BusinessException
  {
    AggSalequotationHVO[] updatevo = { (AggSalequotationHVO)vo };
    

    ISalequotationService srv = (ISalequotationService)NCLocator.getInstance().lookup(ISalequotationService.class);
    

    AggSalequotationHVO[] retvos = null;
    try {
      retvos = srv.saveBase(updatevo);
    }
    catch (Exception ex) {
      ExceptionUtils.wrappException(ex);
    }
    if ((null == retvos) || (retvos.length == 0)) {
      return null;
    }
    return retvos[0];
  }
}